#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#define MAXNUM 10

int main()
{
    char c1[MAXNUM] = { 0 }, c2[MAXNUM] = { 0 };
    scanf("%s%s", c1, c2);

    int Sum = 0;
    int L1 = strlen(c1), L2 = strlen(c2);
    for (int i = 0; i < L1; i++)
        for (int j = 0; j < L2; j++)
            Sum += (c1[i] - '0') * (c2[j] - '0');

    printf("%d", Sum);
    return 0;
}
